#include <kuai/sim/energy.hpp>

#ifndef _KUAI_SIM_STUDIO_HPP_
#define _KUAI_SIM_STUDIO_HPP_

namespace kuai {

	class SpaceControl
	{
	public:
		virtual ~SpaceControl()
		{ }
		virtual void start(SimulationEnvironment& env, PhaseSpace& space, EnergySet& efunc)
		{ }
		virtual void finish(SimulationEnvironment& env, size_t iStep, PhaseSpace& space, EnergySet& efunc)
		{ }
		virtual void act(SimulationEnvironment& env, size_t iStep, PhaseSpace& space, EnergySet& efunc) 
		{ }

		void set(const String& key, const String& data);
		String get(const String& key) const;

	public:
		size_t interval;
	};

	class ControlSet
	{
	public:
		explicit ControlSet(PhaseSpace& space);

		void start(SimulationEnvironment& env, PhaseSpace& space, EnergySet& efunc);
		void finish(SimulationEnvironment& env, size_t iStep, PhaseSpace& space, EnergySet& efunc);
		void act(SimulationEnvironment& env, size_t iStep, PhaseSpace& space, EnergySet& efunc) ;

	private:
		std::vector<SpaceControl*> funcs;
		std::vector<size_t> next_x;
	};

}

#endif
